<div class="gray-bg">
    <!--<div class="bg-light lter b-b wrapper-md">
	    <h1 class="m-n font-thin h3">设备管理</h1>
	</div>-->
	<div class="wrapper">
    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-default">
                <div class="panel-heading">
		              	 设备管理
		              	 <div class="btn bg-color btn-xs" data-dismiss="modal" data-toggle="modal" data-target="#modal_3" style="padding: 0 10px;margin-left: 300px;">导入设备</div>
		              	<div class="pos_abs col-sm-6">
		                	<div class="btn btn_greenyellow btn-xs">&nbsp;&nbsp;</div>&nbsp;正常
		                	<div class="btn btn_red btn-xs" >&nbsp;&nbsp;</div>&nbsp;异常
		                	<div class="btn btn_gray btn-xs" >&nbsp;&nbsp;</div>&nbsp;未注册
		                	<div class="btn btn_blueviolet btn-xs" >&nbsp;&nbsp;</div>&nbsp;锁定
		                </div>
		               
                </div>
                
                <div class="panel-body">
                	
                    <form class="form-group">
                    	<!--<div class="radio col-sm-2" style="padding: 0;">
					            <label class="radio-inline">
					                <input type="radio" checked="" value="FENSAN" ng-model="way_1" name="optionsRadios">分散式</label>
					            <label class="radio-inline">
					                <input type="radio" value="JIZHONG" ng-model="way_1" id="" name="optionsRadios">集中式</label>
						</div>   -->
                        <div class="col-sm-4" style="padding: 0;">
                        	<div class="col-sm-4">
								<select class="inn_select" ng-model="pro_1" ng-change="proFunc_1(pro_1)">
									<option value="">省份 </option>
									<option value="{{k.pro_id}}" ng-repeat="k in prolist">{{k.name}}</option>
								</select>
							 </div>  
	                        <div class="col-sm-4">
	                            <select class="inn_select" ng-model="cty_1" ng-change="ctyFunc_1(cty_1)">
									<option value="">市/地区</option>
									<option value="{{k.city_id}}" ng-repeat="k in citylist">{{k.name}}</option>
								</select>
	                        </div>  
	                        <div class="col-sm-4">
								<select class="inn_select" ng-model="dis_1">
									<option value="">区/县 </option>
									<option value="{{k.dis_id}}" ng-repeat="k in dislist">{{k.name}}</option>
								</select>
							 </div>  
                        </div>  
                        <div class="col-sm-5">
                        	<div class="col-sm-3 padding_right">
	                            <input type="search" class="form-control ng-pristine ng-valid ng-touched" ng-model="tric_nmb"  placeholder="小区名" />
	                        </div>
	                        <div class="col-sm-3 padding_right">
								<input type="search" class="form-control ng-pristine ng-valid ng-touched" ng-model="adr_nmb"  placeholder="地址" />
	                        </div>
	                        <div class="col-sm-2 padding_right">
	                            <input type="search" class="form-control ng-pristine ng-valid ng-touched" ng-model="floor_nmb"  placeholder="楼栋" />
	                        </div>
	                        <div class="col-sm-2 padding_right">
								<input type="search" class="form-control ng-pristine ng-valid ng-touched" ng-model="unit_nmb"  placeholder="单元" />
	                        </div> 
	                        <div class="col-sm-2 padding_right">
								<input type="search" class="form-control ng-pristine ng-valid ng-touched" ng-model="room_nmb"  placeholder="房号" />
	                        </div> 
                        </div>
                        
                       <div class="col-sm-1">
                       	 	<button class="btn bg-color" ng-click="sear_2(pro_1,cty_1,dis_1,tric_nmb,adr_nmb,floor_nmb,unit_nmb,room_nmb)">&nbsp;&nbsp;搜索&nbsp;&nbsp;</button>
                        </div> 
                       
                    </form>
                </div>
                <table class="table table-hover text-center">
				 	<thead>
				        <td>房源编号</td>
				        <td>小区/公寓</td>
				        <td>地址</td>
				        <td>楼栋</td>
				        <td>单元</td>
				        <td>房号</td>
				        <td>房门</td>
				        <td>设备</td>
				        <td>租客</td>
			        </thead>
			        <tbody>
			        	<tr ng-repeat="x in list_1">
			        		<td>{{x.code}}</td>
					        <td>{{x.districtName}}</td>
					        <td>{{x.houseStreet.provinceName}}{{x.houseStreet.cityName}}{{x.houseStreet.distName}}{{x.houseStreet.address}}</td>
					        <td>{{x.floorNo | clearZero}}</td>
					        <td>{{x.unit | clearZero}}</td>
					        <td>{{x.roomNo}}</td>
					        <td>{{x.door}}</td>
					        <td>
					        	<a href="" ng-repeat="k in x.hardwares" id="{{k.type}}{{x.id}}" class="{{k.hardwareStatus}}" style="{{k.type | style}}" ng-click="hardwares(k,x)">{{k.type | warsName}}</a>
					        	<!--<a href="" class="{{}}" data-toggle="modal" data-target="#modal_5" ng-click="eleFuc(x)">电表</a>-->
					        </td>
					        <td>
					        	<a href=""  data-toggle="modal" data-target="#modal_6" ng-click="renter(x.members)">{{x.members.length}}</a>
					        </td>
			        	</tr>
				        
			        </tbody>
			        <tfoot>
			        	<tr>
				            <td colspan="12" id="pager_1">
				               
				            </td>
				        </tr>
						
			        </tfoot>
				</table>
            </div>
        </div>
    </div>
</div>

</div>

<!--门锁详情-->
	<div class="modal fade" id="modal_4" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">门锁详情</h4>
            </div>
            <div class="modal-body wrapper">
            	<div class="row">
            		<div class="col-sm-12">
            			厂商：{{supname_1}}
            		</div>
            		<div class="col-sm-12">
            			供应商设备号：{{devId_1}}
            		</div>
            		<div class="col-sm-12">
            			安装位置：{{hardwdress_1}}
            		</div>
            		<div class="col-sm-12">
            			在线状态：<span style="color:{{clor_1}}">{{hardwareStatus_3 | hardwarestatus_1_1}}</span>
            		</div>
            		<div class="col-sm-12">
            			电池电量：<span style="color:{{clor_2}}">{{hardwareStatus_4 | hardwarestatus_3:hardwareStatus_3}}</span>
            		</div>
            		<div class="col-sm-12">
            			安装上线时间：{{install_1 | date : 'yyyy-MM-dd'}}
            		</div>
            	</div>
            </div>
            <div class="modal-footer">
            	<button type="button" class="btn btn-primary" ng-click="lowPowerHistory(doorLockId,hardwdress_1_1)">低电量历史</button>
            	<button type="button"  class="btn btn-primary" ng-click="doorHistory(doorLockId,hardwdress_1_1)">联网历史</button>
                <button type="button"  class="btn btn-primary" ng-click="openDoor(devId_1,hardwdress_1_1)">开门历史</button>
            	<button type="button" class="btn btn-primary" ng-click="oClear(devId_1)">清除所有密码</button>
            </div>
        </div>
    </div>
</div>
<!--门锁联网历史-->
<div class="modal fade" id="modal_4_3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">低电量历史
                	<div class="btn-group btn-group-sm" role="group" aria-label="...">
					  <button type="button" class="btn btn-default" ng-click="oWeek_4()">7天</button>
					  <button type="button" class="btn btn-default" ng-click="oMonth_4()">30天</button>
					</div>
                </h4>
            </div>
            <div class="modal-body wrapper" style="height:590px;overflow-y: scroll;overflow-x: hidden;">
            	<div class="row">
            		<div class="col-sm-12" style="font-weight: bold;">
            			{{historyDress_2}}
            		</div>
            		<table class="table table-striped text-center" >
					 	<thead>
					        <td>状态</td>
					        <td>时间</td>
				        </thead>
				        <tbody>
				        	<tr ng-show="history_4" ng-repeat="x in oline_p_w">
				        		<td>{{x.type}}</td>
						        <td>{{x.createTime}}</td>
				        	</tr>
				        	<tr ng-hide="history_4" ng-repeat="x in oline_p_m">
				        		<td>{{x.type}}</td>
						        <td>{{x.createTime}}</td>
				        	</tr>
					        
				        </tbody>
				        <tfoot>
							
				        </tfoot>
					</table>
            	</div>
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>
<!--门锁联网历史-->
<div class="modal fade" id="modal_4_2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">门锁联网历史
                	<div class="btn-group btn-group-sm" role="group" aria-label="...">
					  <button type="button" class="btn btn-default" ng-click="oWeek_3()">7天</button>
					  <button type="button" class="btn btn-default" ng-click="oMonth_3()">30天</button>
					</div>
                </h4>
            </div>
            <div class="modal-body wrapper" style="height:590px;overflow-y: scroll;overflow-x: hidden;">
            	<div class="row">
            		<div class="col-sm-12" style="font-weight: bold;">
            			{{historyDress_1}}
            		</div>
            		<table class="table table-striped text-center" >
					 	<thead>
					        <td>状态</td>
					        <td>时间</td>
				        </thead>
				        <tbody>
				        	<tr ng-show="history_3" ng-repeat="x in oline_w_1">
				        		<td>{{x.wifiOnlineStatus | onlineStatus}}</td>
						        <td>{{x.createTime}}</td>
				        	</tr>
				        	<tr ng-hide="history_3" ng-repeat="x in oline_m_1">
				        		<td>{{x.wifiOnlineStatus | onlineStatus}}</td>
						        <td>{{x.createTime}}</td>
				        	</tr>
					        
				        </tbody>
				        <tfoot>
							
				        </tfoot>
					</table>
            	</div>
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>
<!--开门历史-->
	<div class="modal fade" id="modal_4_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">开门记录
                	<div class="btn-group btn-group-sm" role="group" aria-label="...">
					  <button type="button" class="btn btn-default" ng-click="oWeek_1()">7天</button>
					  <button type="button" class="btn btn-default" ng-click="oMonth_1()">30天</button>
					</div>
                </h4>
            </div>
            <div class="modal-body wrapper" style="height:590px;overflow-y: scroll;">
            	<div class="row">
            		<div class="col-sm-12" style="font-weight: bold;">
            			{{openDress}}
            		</div>
            		<table class="table table-striped text-center" >
					 	<thead>
					        <td>开门时间</td>
					        <td>开门方式</td>
					        <td>开门人</td>
				        </thead>
				        <tbody>
				        	<tr ng-show="history" ng-repeat="x in openlist_1">
				        		<td>{{x.openLockTime}}</td>
						        <td>{{x.type | openType}}</td>
						        <td>{{x.phone}}</td>
				        	</tr>
				        	<tr ng-hide="history" ng-repeat="x in openlist">
				        		<td>{{x.openLockTime}}</td>
						        <td>{{x.type | openType}}</td>
						        <td>{{x.phone}}</td>
				        	</tr>
					        
				        </tbody>
				        <tfoot>
							
				        </tfoot>
					</table>
            	</div>
            </div>
            <div class="modal-footer">
            </div>
           
        </div>
    </div>
</div>

<!--电表详情-->
	<div class="modal fade" id="modal_5" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">电表详情</h4>
            </div>
            <div class="modal-body wrapper">
            	<div class="row">
            		<div class="col-sm-12">
            			厂商：{{supname}}
            		</div>
            		<div class="col-sm-12">
            			设备ID：{{devId}}
            		</div>
            		<div class="col-sm-12">
            			供应商设备号：{{MName}}
            		</div>
            		<div class="col-sm-12">
            			安装位置：{{hardwdress}}
            		</div>
            		<div class="col-sm-12">
            			在线状态：<span style="color:{{clor}}">{{hardwareStatus_1 | hardwarestatus_1}}</span>
            		</div>
            		<div class="col-sm-12">
            			通电状态：<span style="color:{{clor_t}}">{{hardwareStatus_2 | hardwarestatus_2}}</span>
            		</div>
            		<div class="col-sm-12">
            			付费模式状态：<span style="color:{{clor_y}}">{{payMod | paymod}}</span>
            		</div>
            		<div class="col-sm-12">
            			安装上线时间：{{install | date : 'yyyy-MM-dd'}}
            		</div>
            		<div class="col-sm-12">
            			单价：{{electricityPrice}}元/度
            		</div>
            	</div>
            </div>
            <div class="modal-footer">
            	<button type="button" class="btn btn-primary" ng-click="powerHistory(ammeterId,hardwdress2)">联网历史</button>
                <button type="button" class="btn btn-primary" ng-click="power(devId,hardwdress2)">电量历史</button>
                <button type="button" class="btn btn-primary" ng-click="loop(devId,hardwareStatus_2)">{{hardwareStatus_2 | hardwarestatus_2_1}}</button>
            </div>
        </div>
    </div>
</div>

<!--电表电量历史-->
	<div class="modal fade" id="modal_5_1" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">电量历史
                	<div class="btn-group btn-group-sm" role="group" aria-label="...">
					  <button type="button" class="btn btn-default" ng-click="oWeek()">7天</button>
					  <button type="button" class="btn btn-default" ng-click="oMonth()">30天</button>
					</div>
                </h4>
            </div>
            <div class="modal-body wrapper" style="height:590px;overflow-y: scroll;overflow-x: hidden;">
            	<div id="" class="row">
            		<div ng-show="chart" id="chart"  style="height: 300px;width: 590px;">
            			
            		</div>
            		
            		<div ng-hide="chart" id="chart_1"  style="height: 300px;width: 590px;">
            			
            		</div>
            		<table class="table table-striped text-center" >
					 	<thead>
					        <td>日期</td>
					        <td>使用电量(度)</td>
					        <td>最后电量(度)</td>
				        </thead>
				        <tbody>
				        	<tr ng-show="chart" ng-repeat="x in power_list">
				        		<td>{{x.Date}}</td>
						        <td>{{x.Allpower | mathFloor}}</td>
						        <td>{{x.Lastpower | mathFloor}}</td>
				        	</tr>
				        	<tr ng-hide="chart" ng-repeat="x in power_list_1">
				        		<td>{{x.Date}}</td>
						        <td>{{x.Allpower | mathFloor}}</td>
						        <td>{{x.Lastpower | mathFloor}}</td>
				        	</tr>
					        
				        </tbody>
				        <tfoot>
							
				        </tfoot>
					</table>
            	</div>
            </div>
            <div class="modal-footer">
                
            </div>
        </div>
    </div>
</div>
<!--设备状态历史-->
<div class="modal fade" id="modal_5_2" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">电表联网历史
                	<div class="btn-group btn-group-sm" role="group" aria-label="...">
					  <button type="button" class="btn btn-default" ng-click="oWeek_2()">7天</button>
					  <button type="button" class="btn btn-default" ng-click="oMonth_2()">30天</button>
					</div>
                </h4>
            </div>
            <div class="modal-body wrapper" style="height:590px;overflow-y: scroll;overflow-x: hidden;">
            	<div class="row">
            		<div class="col-sm-12" style="font-weight: bold;">
            			{{historyDress}}
            		</div>
            		<table class="table table-striped text-center" >
					 	<thead>
					        <td>状态</td>
					        <td>时间</td>
				        </thead>
				        <tbody>
				        	<tr ng-show="history_1" ng-repeat="x in oline_w">
				        		<td>{{x.wifiOnlineStatus | onlineStatus}}</td>
						        <td>{{x.createTime}}</td>
				        	</tr>
				        	<tr ng-hide="history_1" ng-repeat="x in oline_m">
				        		<td>{{x.wifiOnlineStatus | onlineStatus}}</td>
						        <td>{{x.createTime}}</td>
				        	</tr>
					        
				        </tbody>
				        <tfoot>
							<!--<tr>
					            <td ng-show="history" colspan="12" id="pager_3">
					               
					            </td>
					            <td ng-hide="history" colspan="12" id="pager_3_1">
					               
					            </td>
				        	</tr>-->
				        </tfoot>
					</table>
            	</div>
            </div>
            <div class="modal-footer">
            </div>
        </div>
    </div>
</div>
<!--租客-->
	<div class="modal fade bs-example-modal-sm" tabindex="-1" id="modal_6" role="dialog" aria-labelledby="mySmallModalLabel">
	  <div class="modal-dialog modal-sm" role="document">
	    <div class="modal-content">
	    	<div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="">租客信息</h4>
            </div>
	        <table class="table">
	        	<tbody>
	        		<tr ng-repeat="x in oRenter">
	        			<td>{{$index+1}}</td>
				        <td>{{x.name}}</td>
				        <td>{{x.mobile}}</td>
	        		</tr>
	        	</tbody>
			</table>
			
	    </div>
	  </div>
	</div>


<!--导入excel表-->
	<!--编辑-->
	<!--data-dismiss="modal" data-toggle="modal" data-target="#modal_3"-->
	<div class="modal fade" id="modal_3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="myModalLabel">导入房源</h4>
            </div>
            <div class="modal-body wrapper">
            	<div class="row">
            		<div class="col-sm-12">
            			<div class="col-sm-8">
            				<div class="">
            					<form id="uploadForm">
            						<div class="col-sm-10">
			            				<input id="file_input" type="file" name="file" accept="application/vnd.ms-excel" file-model="myFile" ng-click="clearItems()" />
		            				</div>
		            				<div class="col-sm-2">
		            					<button type="button" class="btn btn-primary btn-xs" style="height: 30px;" ng-click="UploadFile()">导入excel</button>
	            					</div>
            					</form>
            				</div>
            			</div>
            			<!--<button type="button" class="btn btn-primary btn-xs" style="height: 30px;" ng-click="UploadFile()">导入excel</button>-->
            		</div>
            	</div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-default " id="" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>

<!--public弹窗-->
	<public-alert></public-alert>
